package com.jdrx.sw.sewage.dao;

import com.jdrx.sw.sewage.beans.dto.DeviceAlarmsQueryDTO;
import com.jdrx.sw.sewage.beans.dto.StationIdDTO;
import com.jdrx.sw.sewage.beans.entity.DevStoragePO;
import com.jdrx.sw.sewage.beans.entity.DevicePO;
import com.jdrx.sw.sewage.beans.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * 设备DAO（sewage_device）
 * Created by generator on 2020-10-12.
 */
@Mapper
public interface DeviceDAO {

    DeviceIotVO selectDeviceByIotGatewayNumAndKey(@Param("iotGatewayNum") String iotGatewayNum,
                                                  @Param("key") String key,
                                                  @Param("dataNode") String dataNode);

    List<DeviceIotVO> selectMQDevices(@Param("gatherDevId") Long gatherDevId);

    void assetsCollect(DevicePO devicePO);

    List<StorageDeviceVO> selectByStIdAndPId(@Param("stationId") Long stationId,
                                             @Param("processunitId") Long processunitId);

    List<StorageDeviceVO> selectByStId(@Param("stationId") Long stationId);

    List<DeviceAlarmQueryPageVO> selectAlarmsByDevId(DeviceAlarmsQueryDTO queryDTO);

    DeviceVO getById(@Param("deviceId") Long deviceId);

    Long selectByStorageDevId(@Param("devId") Long devId);

    void deletById(@Param("deviceId") Long deviceId);

    void updateDispatch(@Param("devId") Long devId,
                        @Param("noDispatch") Integer noDispatch);

    DevStoragePO findByMaintenanceId(@Param("maintenanceId") Long maintenanceId);

    List<DevRunTimeVO> findRunTime(StationIdDTO dto);

    Integer countMaintenanceSevenDay(@Param("stationId") Long stationId,
                                     @Param("type") Integer type);

    Integer countDevTotalNum();

    Integer countByGatherDevId(@Param("gatherDevId") Long gatherDevId);

    Integer countByPuIdAndDeviceName(@Param("processunitId") Long processunitId,
                                     @Param("deviceName") String deviceName);

    List<String> findDevPointBydevId(@Param("devId") Long devId);

    DevicePO findById(@Param("devId") Long devId);
}